package com.xmy.cultivate.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xmy.cultivate.entity.StaffStationChange;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 岗位调动 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2024-02-01
 */
public interface StaffStationChangeMapper extends BaseMapper<StaffStationChange> {

    @Select("select * from (select a.*,b.`name`,b.`school_id`,DATE_FORMAT(a.change_date_time,'%Y%m%d') as change_date from staff_station_change as a LEFT JOIN staff as b on a.staff_id = b.id) as t ${ew.customSqlSegment}")
    public abstract IPage<StaffStationChange> getTransferList(IPage<?> page, @Param(Constants.WRAPPER) Wrapper wrapper);

}
